from .model.config import Config
from .generator import Generator
import json


def create_ques(myconf, classname):
    mygen = Generator()
    # myconf = Config(hasfraction=False, hasmulanddiv=True, numofexp=5, myrange=5)
    set_expression = mygen.generate(myconf)

    ret = mygen.format_expression(set_expression, classname)
    t = dict()
    t["questions"] = ret
    return t
    # return json.dumps(t, ensure_ascii=False)
